{extend name="base_mobile" /}
{block name="body"}
<header class="hui-header">
    <div id="hui-back"></div>
    <h1>编辑数据</h1>
</header>
<div class="hui-wrap">
    <form action="{:request()->url()}" class="hui-form" method="post">
        <div class="hui-form-items">
            <div class="hui-form-items-title">配置分组</div>
            <div class="hui-form-select">
                <select name="group" {if isset($data.is_sys) == '1'}disabled{/if}>
                    <option value="">请选择配置分组</option>
                    {foreach name=":config('customer')" key="k" item="v"}
                    <option value="{$k}" {if condition="isset($data) and $data.group eq $k"}selected="selected"{/if}>{$v}[{$k}]</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="hui-form-items">
            <div class="hui-form-items-title">配置标题</div>
            <input type="text" name="title" value="{$data.title|default=''}" autocomplete="off" class="hui-input hui-input-clear">
        </div>
        <div class="hui-form-items">
            <div class="hui-form-items-title">配置标识</div>
            <input type="text" name="name" value="{$data.name|default=''}" autocomplete="off" class="hui-input hui-input-clear" {if isset($data.is_sys)=='1'}disabled{/if}>
        </div>
        <div class="hui-form-items">
            <div class="hui-form-items-title">配置类型</div>
            <div class="hui-form-select">
                <select name="type" {if isset($data.is_sys)=='1'}disabled{/if}>
                    <option value="">请选择配置类型</option>
                    {foreach name=":config('configType')" key="k" item="v"}
                    <option value="{$k}" {if condition="isset($data) and $data.type eq $k"}selected="selected"{/if}>{$v}[{$k}]</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="hui-form-items">
            <div class="hui-form-items-title">默认值</div>
            <input type="text" name="value" value="{$data.value|default=''}" autocomplete="off" class="hui-input">
        </div>
        <div class="hui-form-items">
            <div class="hui-form-items-title">选项值</div>
            <div class="hui-form-textarea">
                <textarea name="options" class="layui-textarea" placeholder="此配置仅适用于配置类型为单选项、下拉选项。参考格式如下：
1:是
0:否" style="height:130px">{$data.options|default=''}</textarea>
            </div>
        </div>
        <div style="padding:15px 8px;">
            <button class="hui-button hui-button-large hui-primary" lay-filter="*" lay-submit="">保存</button>
        </div>

    </form>
</div>
{/block}
